package com.boscloud.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.boscloud.pojo.ProductOrderDetail;
import com.boscloud.pojo.User;
import com.boscloud.service.UserService;
import com.boscloud.service.postSapServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import  org.springframework.http.HttpEntity;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@CrossOrigin //允许跨域
@RestController
public class UserController {
    @Autowired
    private UserService UserService;
    @PostMapping("/userList")
    public List<User> getUserList(){
        return UserService.getUserList();
    }

//    @PostMapping("/OrderDetails")
//    public  List<ProductOrderDetail> getOrderDetails(@RequestBody Map<String, String> params) throws IOException {
//        String result = postSapServices.post(params);
//        List<ProductOrderDetail> productOrderDetails = JSON.parseObject(result,List.class);
//        return productOrderDetails;
//
//    }

}
